﻿// JSON C# Class Generator
// http://at-my-window.blogspot.com/?page=json-class-generator

using System;
using Newtonsoft.Json.Linq;
using JsonCSharpClassGenerator;
using TomatoSynchronizer.Store;

namespace TomatoSynchronizer.Entities 
{
    public class ProductAttachment 
    {
    	public override bool Equals(object obj)
		{
			if(obj is ProductAttachment)
			{
				ProductAttachment file = (ProductAttachment)obj;
				if(file._attachments_description == _attachments_description && file._attachments_file_name == _attachments_file_name && file._attachments_name == _attachments_name)
				{
					return true;
				}
			}
			
			return false;
		}

        public ProductAttachment()
        {
        }

        public ProductAttachment(string json)
         : this(JObject.Parse(json))
        {
        }

        private JObject __jobject;
        public ProductAttachment(JObject obj)
        {
            this.__jobject = obj;
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }        

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private string _attachments_id;
        public string attachments_id
        {
            get
            {
                if(_attachments_id == null)
                    _attachments_id = JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "attachments_id"));
                return _attachments_id;
            }
            set
            {
                _attachments_id = value;
            }
        }

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private string _attachments_name;
        public string attachments_name
        {
            get
            {
                if(_attachments_name == null)
                    _attachments_name = JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "attachments_name"));
                return _attachments_name;
            }
            set
            {
                _attachments_name = value;
            }
        }

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private string _attachments_file_name;
        public string attachments_file_name
        {
            get
            {
                if(_attachments_file_name == null)
                    _attachments_file_name = JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "attachments_file_name"));
                return _attachments_file_name;
            }
            set
            {
                _attachments_file_name = value;
            }
        }

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private string _attachments_description;
        public string attachments_description
        {
            get
            {
                if(_attachments_description == null)
                    _attachments_description = JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "attachments_description"));
                return _attachments_description;
            }
            set
            {
                _attachments_description = value;
            }
        }

    }
}
